class Solution
{
public:
    string getEncryptedString(string s, int k)
    {
        string result = s;
        int n = s.size();
        for (int i = 0; i < n; ++i)
        {
            result[i] = s[(i + k) % n];
        }
        return result;
    }
};